#ifndef _CWIDGETFACTORY_H_
#define _CWIDGETFACTORY_H_

namespace buola { namespace gui {

class CWidgetFactory
{
public:
    CWidgetFactory();
    virtual ~CWidgetFactory();

    std::wstring mName;
    std::wstring mDescription;
    PIcon GetIcon();
    
    std::vector<std::unique_ptr<CPropertyField>> mProperties;

    void RemoveProperty(const std::wstring&);

    virtual PWindow GetOne()=0;

    static CWidgetFactory* GetFactory(const std::wstring&);
    static void LoadAll();
    static void Add(CWidgetFactory*);

    static int size()               {   return mFactories.size();   }
    static CWidgetFactory *Get(int i)   {   return mFactories[i].get();          }

protected:
    static std::vector<std::unique_ptr<CWidgetFactory>> mFactories;
    static bool mLoaded;

    PIcon mIcon;
    std::string mIconName;
};

/*namespace gui*/ } /*namespace buola*/ }

#endif
